#include <iostream>
#include <map>
#include <string>

using namespace std;

int main()
{
	map<int, string> mapstring;
	mapstring.insert(pair<int, string>(1,"one"));
	mapstring.insert(pair<int, string>(4,"four"));
	mapstring.insert(pair<int, string>(3,"three"));
	mapstring.insert(pair<int, string>(2,"two"));
	mapstring.insert(pair<int, string>(4,"four four"));

	mapstring[1] = "one one";
	mapstring[5] = "five";

	cout << mapstring[1] << endl;

	mapstring.erase(2);
	map<int, string>::iterator f = mapstring.find(2);
	if(f!=mapstring.end())
	{
		mapstring.erase(f);
	}

	map<int, string>::iterator it = mapstring.begin();
	while(it != mapstring.end())
	{
		cout << (*it).first << " " << (*it).second << endl;
		it++;
	}

	return 0;
}
